libglnx porting: Port "load utf8 file" contents API callers
authorColin Walters <walters@verbum.org>
Sun, 29 May 2016 17:23:04 +0000 (13:23 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Mon, 30 May 2016 11:33:28 +0000 (11:33 +0000)
Closes: #312
Approved by: giuseppe

src/libostree/ostree-bootloader-syslinux.c
src/libostree/ostree-bootloader-uboot.c
src/libotutil/ot-gio-utils.c
src/ostree/ot-editor.c

index 16951629eb855152ed2df05dc0002ce177d97fc1..05cb173eec2d8c2ed0b8ac90487b2fdb8ec5ea6b 100644 (file)
@@ -138,7 +138,8 @@ _ostree_bootloader_syslinux_write_config (OstreeBootloader          *bootloader,
                                                   bootversion);
 
   /* This should follow the symbolic link to the current bootversion. */
-  config_contents = gs_file_load_contents_utf8 (self->config_path, cancellable, error);
+  config_contents = glnx_file_get_contents_utf8_at (AT_FDCWD, gs_file_get_path_cached (self->config_path), NULL,
+                                                    cancellable, error);
   if (!config_contents)
     goto out;
 
index f67e9bdb42fa75ee88d9172fe25a973db8b1e304..f95ea8431e92969124d858e6bdea257a90281b7a 100644 (file)
@@ -113,7 +113,8 @@ _ostree_bootloader_uboot_write_config (OstreeBootloader          *bootloader,
   g_autoptr(GPtrArray) new_lines = NULL;
 
   /* This should follow the symbolic link to the current bootversion. */
-  config_contents = gs_file_load_contents_utf8 (self->config_path, cancellable, error);
+  config_contents = glnx_file_get_contents_utf8_at (AT_FDCWD, gs_file_get_path_cached (self->config_path), NULL,
+                                                    cancellable, error);
   if (!config_contents)
     return FALSE;
 
index 9b8b0dce10089cb4bb625f3ec34b34d19dab48f1..103f6edde9d98134ec6445539e35981b1668bec4 100644 (file)
@@ -254,7 +254,8 @@ ot_gfile_load_contents_utf8_allow_noent (GFile          *path,
   GError *temp_error = NULL;
   g_autofree char *ret_contents = NULL;
 
-  ret_contents = gs_file_load_contents_utf8 (path, cancellable, &temp_error);
+  ret_contents = glnx_file_get_contents_utf8_at (AT_FDCWD, gs_file_get_path_cached (path), NULL,
+                                                 cancellable, &temp_error);
   if (!ret_contents)
     {
       if (g_error_matches (temp_error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND))
index 2e0458447d54661b90547c1466aeb50c3c7a84b4..66c6e7be3bce296771b4f9e351878abf894dcdd6 100644 (file)
@@ -101,7 +101,8 @@ ot_editor_prompt (OstreeRepo *repo,
       goto out;
     }
 
-  ret = gs_file_load_contents_utf8 (file, cancellable, error);
+  ret = glnx_file_get_contents_utf8_at (AT_FDCWD, gs_file_get_path_cached (file), NULL,
+                                        cancellable, error);
 
 out:
   if (file)